If you are noting down the color of cars passing through an intersection in a time interval and observe:[1]
green, blue, red, red, white, black, green, red, black, black, black, red, blue, white |
The total number of observations (or cars) is 14.
Number of green cars observed within time interval: 2
Number of blue cars observed within time unit: 2
Number of red cars observed within time unit: 4
Number of white cars observed within time unit: 2
Number of black cars observed within time unit: 4
The relative frequency of green cars is: 2/14
The relative frequency of blue cars is: 2/14
The relative frequency of red cars is: 4/14
The relative frequency of white cars is: 2/14
The relative frequency of black cars is: 4/14
A class interval is a predetermined numerical category that can contain more than one possible observation in its range. The size of a class interval is fairly arbitrary. However, with some skill, we can select reasonably-sized intervals that are helpful.
When constructing a frequency distribution, a good rule of thumb is to select between 5 and 15 classes, too few classes and the data summary may be too general to be useful. Too many classes may result in a frequency distribution that does not aggregate the data enough to be useful. The business researcher arrives at a final number of classes by examining the range and determining a number of classes that will span the range adequately and be meaningful to the user.
Finally an approximation of the class width can be calculated by dividing the range by the number of classes. The resulting number is normally rounded up to the next whole number. The frequency distribution must start at a value equal to or higher than the highest number. The range is the difference between the largest and smallest numbers.
See examples at: http://courses.csusm.edu/soc201kb/level_of_measurement.htm